package com.police.activity;

import android.app.Activity;
import android.graphics.drawable.Drawable;
import android.view.View;
import com.astrob.mapapi.core.PoiItem;
import com.astrob.mapapi.map.MapView;
import com.astrob.mapapi.map.MapView.LayoutParams;
import com.astrob.mapapi.map.PoiOverlay;
import com.police.R;

public class MyPoiOverlay extends PoiOverlay{
	private Activity mActivity; 
	private MapView mMapView;

	public MyPoiOverlay(Activity activity, MapView mapView) {
		super(activity, mapView);
		// TODO Auto-generated constructor stub
		mActivity = activity;
		mMapView = mapView;
	}

	@Override
	protected View getPopupView(PoiItem poiItem) {
		// TODO Auto-generated method stub
		//return super.getPopupView(poiItem);
		PoiTip tip = new PoiTip(mActivity);
		tip.setData(poiItem);
		//tip.setL
		return tip;
	}

	@Override
	protected Drawable getPopupBackground() {
		// TODO Auto-generated method stub
		return mActivity.getResources().getDrawable(R.drawable.navi_facilities_u);
	}

	@Override
	protected LayoutParams getLayoutParam(int index) {
		// TODO Auto-generated method stub
		//return super.getLayoutParam();
		PoiItem poiItem = getItem(index);
		return new LayoutParams(-2, -2, poiItem.getPoint(),
				0, -10, LayoutParams.BOTTOM_CENTER);
	}
	
	
}
